public class Job03 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i <= 500; i++) {
            int line = (count + 1) % 5;
            if ((i%2 == 0) || (i%5 == 0) || (i%7 == 0)){
                count++;
                System.out.print(i+" ");
            }
            switch (line) {
                case 0:
                    System.out.println("  ");
                    break;
                default:
            }
        }
        System.out.println("符合条件的数共有" + count + "个");
    }

}
